You Sold Your House for a Profit. Congratulations - the IRS Would Like to Be Your Plus-One.

You listed. You staged. You got through six rounds of showings and one buyer who wanted to negotiate the kitchen faucet. And then you closed. The money hit. You made a profit.

Here is the part nobody mentions at closing: that profit has a name in the tax code. It is called a capital gain, and depending on how much you made, how long you owned the home, and whether you actually lived in it, the IRS may want a share. The good news is there is a provision specifically designed to protect most homeowners from a massive tax bill. The not-so-good news is most people do not know it exists until they are sitting across from an accountant.

So let's get into it now, before that meeting.

What Is a Capital Gain on a Home Sale?

A capital gain is the difference between what you sold something for and what you originally paid for it. For real estate, the formula is straightforward:

Sale price minus adjusted cost basis = capital gain

Your cost basis is what you paid for the home, plus certain costs you are allowed to add to it. That includes closing costs from when you originally purchased, capital improvements made over the years (a new roof, an addition, a full kitchen renovation), and certain selling expenses. What does not count: repairs, maintenance, and yes, the faucet.

Example: You bought a home in 2016 for $400,000. Over the years you spent $60,000 on a kitchen renovation and new HVAC system. You sold in 2024 for $850,000. Your adjusted basis is $460,000, which means your capital gain is $390,000. That is the number that matters.

Now, $390,000 sounds like a big taxable number. It would be, except for one of the most taxpayer-friendly provisions in the entire Internal Revenue Code.

The Section 121 Exclusion: Your Best Friend in Real Estate Tax

Section 121 of the IRC allows you to exclude (not defer, not reduce, actually exclude) up to $250,000 of capital gain if you are single, and up to $500,000 if you are married filing jointly.

That is not a typo. Half a million dollars of profit, completely tax-free, if you qualify.

The key phrase is: if you qualify.

The Ownership and Use Test

To claim the Section 121 exclusion, you need to satisfy two tests:

  • Ownership test: You owned the home for at least 2 of the last 5 years before the sale.

  • Use test: You used the home as your primary residence for at least 2 of the last 5 years before the sale.

The two years do not need to be continuous, and they do not need to be the same two years as long as both tests are satisfied. You can only claim this exclusion once every two years.

Where people get tripped up: The lookback window is 5 years, not 2. If you moved out of your home three years ago and just sold it, your eligibility depends on whether you still hit the two-year threshold within that window. The clock matters more than people expect.

What Happens if You Do Not Qualify, or Your Gain Exceeds the Exclusion?

If your gain is above the exclusion limit, the excess is taxable. The rate you pay depends on your income and how long you held the property.

Short-term vs. Long-term Capital Gains

If you owned the home for one year or less, your gain is taxed as ordinary income, the same rate as your salary. Depending on your bracket, that can reach 37%.

If you owned it for more than one year, your gain is taxed at the preferential long-term capital gains rates: 0%, 15%, or 20%, depending on your income. For most households, that is 15%.

2024 to 2025 Long-Term Capital Gains Tax Rates

  • 0%: Single filers with taxable income up to $47,025; married filing jointly up to $94,050

  • 15%: Single up to $518,900; married filing jointly up to $583,750

  • 20%: Above those thresholds

There is also the Net Investment Income Tax (NIIT), an additional 3.8% surcharge that applies when your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). It applies to the lesser of your net investment income or the amount by which your MAGI exceeds the threshold. It stacks on top of the capital gains rate, so it is worth knowing about before you close.

Partial Exclusions: When Life Does Not Follow the IRS's Schedule

Job relocation. Divorce. A health situation. Sometimes you need to sell before you have hit the two-year mark. The IRS has a provision for this.

If you fail to meet the full ownership and use test due to a change in employment, health, or other unforeseen circumstances, you may still qualify for a partial exclusion. The amount is prorated based on how long you actually lived in the home relative to the two-year requirement.

Example: You lived in the home for 12 months out of the required 24 and had to sell due to a job relocation. You may be able to exclude up to half the normal amount: $125,000 if single, $250,000 if married filing jointly. Not the full benefit, but a meaningful one.

Common Mistakes That Cost People Real Money

  • Not tracking capital improvements. Every legitimate dollar added to your cost basis reduces your taxable gain. Keep receipts from the day you close on a purchase. Every year.

  • Assuming the exclusion is automatic. You have to qualify. If you have been renting your home out and have not used it as a primary residence recently, you may not meet the use test.

  • Forgetting about depreciation recapture. If you ever claimed depreciation on this property, even as a short-term rental, the IRS will recapture it when you sell. This is its own article (and in fact, it is our next one).

  • Assuming the exclusion eliminates all tax exposure. If your gain is $700,000 and you are single, only $250,000 is excluded. The remaining $450,000 is taxable. That is a check worth planning ahead for.

So What Should You Actually Do?

If you are planning to sell or have recently sold, the honest answer is this: the math here is only as good as the inputs. Your cost basis, your timeline, your income in the year of sale, whether you have depreciation to recapture, these all matter and they interact in ways that make a real difference in the final number.

The Section 121 exclusion is genuinely one of the most valuable tax benefits available to individual taxpayers. But claiming it correctly, maximizing your basis, and applying any partial exclusion that might be available takes someone who does this work every day.

The IRS does not grade on a curve.

Sold a property recently, or planning to?
At JSP, we specialize in real estate tax strategy for individuals and investors. Before you file, let's make sure you are keeping as much of that profit as the law allows.
Book a consultation with us.

This is Part 1 of a 3-part Real Estate Tax Series. Next up: Depreciation Recapture, the tax bill that shows up after you already celebrated.